package com.supply.dl.widget.adapter;

import android.content.Context;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import com.supply.dl.activity.fragment.NoJobItemFragment;
import com.supply.dl.bean.NotJobInfo;

import java.util.ArrayList;

public class TranfersNoJobAdapter extends FragmentPagerAdapter
{
	private ArrayList<NotJobInfo> weaponTypes;

	/**
	 * 与该类相关联的上下文
	 */
	private Context mContext;

	public TranfersNoJobAdapter(FragmentManager fm, Context mContext, ArrayList<NotJobInfo> weaponTypes)
	{
		super(fm);
		this.mContext = mContext;
		this.weaponTypes = weaponTypes;
	}

	@Override public Fragment getItem(int i)
	{
		Fragment fragment = Fragment.instantiate(mContext, NoJobItemFragment.class.getName());
		Bundle bundle = new Bundle();
//		bundle.putParcelableArrayList("postId", (ArrayList<? extends Parcelable>) weaponTypes.get(i).getPositinInfoList());
		fragment.setArguments(bundle);
		return fragment;
	}

	@Override public CharSequence getPageTitle(int position)
	{
		return weaponTypes.get(position).getSkuName();
	}

	@Override public int getCount()
	{
		return weaponTypes.size();
	}
}
